package com.cxy.instarsystem.dao;

import com.cxy.instarsystem.po.News;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;


import java.util.List;


public interface NewsRepository extends JpaRepository<News, Long> {

    News getNewsById(Long id);

    @Query("select n from News n")
    List<News> findTop(Pageable pageable);

}
